<?php get_header(); ?>
 <div id="container">
<div id="main">
<div id="single">
 <?php if (have_posts()) : ?>
	<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
	<?php /* If this is a category archive */ if (is_category()) { ?>
	<div class="cat2"><h3>Архив рубрики "<?php single_cat_title(); ?>" </h3></div>
	<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
	<div class="cat2"><h3>Записи с меткой "<?php single_tag_title(); ?>"</h3></div>
	<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
	<div class="cat2"><h3>Архив за <?php the_time(' j F Y'); ?></h3></div>
	<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
	<div class="cat2"><h3>Архив  <?php the_time(' F  Y'); ?></h3></div>
	<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
	<div class="cat2"><h3>Архив  <?php the_time('Y'); ?></h3></div>
	<?php /* If this is an author archive */ } elseif (is_author()) { ?>
	<div class="cat2"><h3>Архив автора  <?php the_author_posts_link(); ?></h3></div>
	<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
	<div class="cat2"><h3>Архив блога</h3></div>		
	<?php } ?>
  <?php while (have_posts()) : the_post(); ?>
  <br />
<div class="cat">
<h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h3>
</div>
  <div class="widget">
  <span class="time">
<?php the_time('jS F  Y') ?> &nbsp; &nbsp; <?php edit_post_link('Редактировать запись', ' &nbsp;', ''); ?>
</span>
  <span class="aut">
Автор: <?php the_author_posts_link(); ?>
</span> 
  <div style="clear:both;"></div> 
<?php $thumb = get_post_meta($post->ID, 'image', $single = true); ?>
<?php 
if($thumb !== '') { ?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=80&amp;w=80&amp;q=60&amp;zc=1" alt="<?php if($thumb_alt !== '') { echo $thumb_alt; } else { echo the_title(); } ?>" class="img-left" /></a>
<?php }
else { echo ''; } ?>
<?php the_content_limit(600, ""); ?> 

<span class="more">
<a href="<?php the_permalink() ?>"  title="читать запись полностью <?php the_title_attribute(); ?>">Далее</a>
</span>
  <div style="clear:both;"></div> 
</div> 
<?php endwhile; ?>


<div class="wp-pagenavi"><?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?></div> 


</div><!--single-->
	<?php endif; ?>
</div><!--main-->
 <?php get_sidebar(); ?>
</div><!--container-->
<?php get_footer(); ?>